<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/" />
<title>pyi-makespec</title>
<meta name="author" content="Giovanni Bajo" />
<meta name="copyright" content="2005-2011 by Giovanni Bajo, based on previous work under copyright 2002 McMillan Enterprises, Inc." />
<link rel="stylesheet" href="stylesheets/default.css" type="text/css" />
</head>
<body>
<div class="document" id="pyi-makespec">
<h1 class="title">pyi-makespec</h1>
<h2 class="subtitle" id="create-a-spec-file-for-your-pyinstaller-project">Create a spec file for your <cite>PyInstaller</cite> project</h2>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Giovanni Bajo</td></tr>
<tr><th class="docinfo-name">Copyright:</th>
<td>2005-2011 by Giovanni Bajo, based on previous work under copyright 2002 McMillan Enterprises, Inc.</td></tr>
<tr><th class="docinfo-name">Version:</th>
<td>PyInstaller 2.0</td></tr>
<tr class="field"><th class="docinfo-name">Manual section:</th><td class="field-body">1</td>
</tr>
</tbody>
</table>
<div class="section" id="synopsis">
<h1>SYNOPSIS</h1>
<p><tt class="docutils literal"><span class="pre">pyi-makespec</span></tt> &lt;options&gt; SCRIPT [SCRIPT ...]</p>
</div>
<div class="section" id="description">
<h1>DESCRIPTION</h1>
<p>The spec file is the description of what you want <cite>PyInstaller</cite> to do
with your program. <tt class="docutils literal"><span class="pre">pyi-makespec</span></tt> is a simple wizard to create spec
files that cover basic usages:</p>
<pre class="literal-block">
py-Makespec [--onefile] yourprogram.py
</pre>
<p>By default, <tt class="docutils literal"><span class="pre">pyi-makespec</span></tt> generates a spec file that tells
<cite>PyInstaller</cite> to create a distribution directory contains the main
executable and the dynamic libraries. The option <tt class="docutils literal"><span class="pre">--onefile</span></tt>
specifies that you want PyInstaller to build a single file with
everything inside.</p>
<p>In most cases the specfile generated by <tt class="docutils literal"><span class="pre">pyi-makespec</span></tt> is all you
need. If not, see <cite>When things go wrong</cite> in the manual and be sure to
read the introduction to <cite>Spec Files</cite>.</p>
</div>
<div class="section" id="options">
<h1>OPTIONS</h1>
<div class="section" id="general-options">
<h2>General Options</h2>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-h</span>, <span class="option">--help</span></kbd></td>
<td>show this help message and exit</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--log-level=<var>LOGLEVEL</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>Log level for MakeSpec.py (default: INFO, choose
one of DEBUG, INFO, WARN, ERROR, CRITICAL)</td></tr>
</tbody>
</table>
</div>
<div class="section" id="what-to-generate">
<h2>What to generate</h2>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-F</span>, <span class="option">--onefile</span></kbd></td>
<td>create a single file deployment</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-D</span>, <span class="option">--onedir</span></kbd></td>
<td>create a single directory deployment (default)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-o <var>DIR</var></span>, <span class="option">--out=<var>DIR</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>generate the spec file in the specified directory
(default: current directory)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-n <var>NAME</var></span>, <span class="option">--name=<var>NAME</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>name to assign to the project (default: first script's
basename)</td></tr>
</tbody>
</table>
</div>
<div class="section" id="what-to-bundle-where-to-search">
<h2>What to bundle, where to search</h2>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-p <var>DIR</var></span>, <span class="option">--paths=<var>DIR</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>set base path for import (like using PYTHONPATH).
Multiple directories are allowed, separating them with
':', or using this option multiple times</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--additional-hooks-dir=<var>HOOKSPATH</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>additional path to search for hooks (may be given
several times)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--ascii</span></kbd></td>
<td>do NOT include unicode encodings (default: included if
available)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--hidden-import=<var>MODULENAME</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>import hidden in the script(s). This option can be
used multiple times.</td></tr>
</tbody>
</table>
</div>
<div class="section" id="how-to-generate">
<h2>How to generate</h2>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--debug</span></kbd></td>
<td>use the debug (verbose) build of the executable for
packaging. This will make the packaged executable be
more verbose when run.</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--strip</span></kbd></td>
<td>strip the exe and shared libs (don't try this on
Windows)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--upx</span></kbd></td>
<td>use UPX if available (works differently between
Windows and *nix)</td></tr>
</tbody>
</table>
</div>
<div class="section" id="windows-specific-options">
<h2>Windows specific options</h2>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-c</span>, <span class="option">--console</span>, <span class="option">--nowindowed</span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>use a console subsystem executable (Windows only)
(default)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-w</span>, <span class="option">--windowed</span>, <span class="option">--noconsole</span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>use a Windows subsystem executable (Windows only)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-v <var>FILE</var></span>, <span class="option">--version=<var>FILE</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>add a version resource from FILE to the exe
(Windows only)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-i <var>ICON_or_FILE_ID</var></span>, <span class="option">--icon=<var>ICON_or_FILE_ID</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>If file is an .ico file, add the icon to the final
executable. Otherwise, the syntax 'file.exe,id' to
extract the icon with the specified id from file.exe
and add it to the final executable</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-m <var>FILE_or_XML</var></span>, <span class="option">--manifest=<var>FILE_or_XML</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>add manifest FILE or XML to the exe (Windows only)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-r <var>RESOURCE</var></span>, <span class="option">--resource=<var>RESOURCE</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td><p class="first">RESOURCE is of format FILE[,TYPE[,NAME[,LANGUAGE]]].</p>
<p class="last">Add or update resource of the given type, name and
language from FILE to the final executable. FILE
can be a data file or an exe/dll. For data files,
atleast TYPE and NAME need to be specified,
LANGUAGE defaults to 0 or may be specified as
wildcard * to update all resources of the given
TYPE and NAME. For exe/dll files, all resources
from FILE will be added/updated to the final
executable if TYPE, NAME and LANGUAGE are omitted
or specified as wildcard *. Multiple resources
are allowed, using this option multiple times.</p>
</td></tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="see-also">
<h1>SEE ALSO</h1>
<p><tt class="docutils literal"><span class="pre">pyi-build</span></tt>(1), The PyInstaller Manual, <tt class="docutils literal">pyinstaller</tt>(1)</p>
<p>Project Homepage <a class="reference external" href="http://www.pyinstaller.org">http://www.pyinstaller.org</a></p>
</div>
</div>
<div class="footer">
<hr class="footer" />
<a class="reference external" href="source/pyi-makespec.rst">View document source</a>.
Generated on: 2012-08-08 18:25 UTC.
Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.

</div>
</body>
</html>
